Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toggle for dark and light mode — updates to #96 #1

Open
wants to merge 30 commits into
base: add-toggle-for-dark-and-light-mode
Choose a base branch
from

Conversation

seanoliver
Copy link

@eshack94 @swyxio — It's alive! Merging this change into @eshack94's branch, and I think (assuming we are okay with the fact that this doesn't yet work for Bing) we should be good to merge this in with main.

@eshack94 I hope you don't mind me jumping in on this; I started by making a few small changes and then got carried away.

FYI that I had to bring it back up to speed with main in order to access the "dev mode" change we recently made makes debugging the individual webviews a lot easier, so unfortunately it looks like more files have been touched than necessarily have. Basically, this includes all of the recent changes we made around removing full screen mode, adding dev mode, adding Together as a provider, and a few updates to the README.

So if you ignore edits related to those things here's what changed:

  1. Moved the handleDarkMode() method into the parent Provider class with a default implementation that works out of the box for most providers (i.e. just adding and removing the 'dark' class from the html tag).
  2. Bard, Bing, and Claude2 don't work this way, so they have their own dark mode implementations in their relevant files.
  3. Was able to get the keyboard shortcut to work globally by moving it to the general keydown listener we have in interface.js.
  4. I am still looping over enabled providers to do the change because the DOM needs to be rendered for the JS/CSS to work (forgot that part). That said the panels won't get out of sync because we're setting the dark mode boolean globally and having all the panels align to whatever the global state is.

Unfortunately, something is still not working with dark mode for Phind and Bing. I can get them working to work in the chrome console so there must be something else going on here.

But besides those two, it's looking good!

darkmode-top4.mp4

If you're both in agreement, we can merge this into @eshack94's branch and then merge @eshack94's branch into main.

seanoliver and others added 27 commits July 30, 2023 22:29
…dify window hiding function with manual flag, feat(index.js) add double-click on tray for quicker open.
Co-authored-by: swyxio <[email protected]>
…ctron ipcRenderer, refactor(provider) remove unnecessary white spaces
@swyxio
Copy link

swyxio commented Aug 3, 2023

incredible! trying this out now

@swyxio
Copy link

swyxio commented Aug 3, 2023

merged in smol-ai#107

@swyxio swyxio deleted the branch eshack94:add-toggle-for-dark-and-light-mode August 16, 2023 01:42
@swyxio swyxio deleted the add-toggle-for-dark-and-light-mode branch August 16, 2023 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants